package edu.sctu.practice.class02.luohui.test11;

/**
 * Created by asus on 2015/10/14.
 */
public class MyTime {
    private int hour;
    private int minute;
    private int second;
    public MyTime(int hour, int minute, int second) {
        this.hour = hour;
        this.minute = minute;
        this.second = second;
    }
    public void display() {
        System.out.println("the time is "+this.hour+":"+this.minute+":"+this.second);
    }
    public void addHour(int hou) {
        this.hour=this.hour+hou;
    }
    public void addSecond(int sec) {
        this.second=this.second+sec;
    }
    public void addMinute(int min) {
        this.minute=this.minute+min;
    }
    public void subHour(int hou) {
        this.hour=this.hour-hou;
    }
    public void subMinute(int min) {
        this.minute=this.minute-min;
    }
    public void subSecond(int sec) {
        this.second=this.second-sec;
    }
}
